<?php
$action = 'insert';
if (isset ( $this->objectData )) {
	$action = 'update';
}
?>
<p id="title"><?php  echo $this->title; ?>  </p>
<form method="POST" name="boo">
<input type="hidden" name="actiontype" value="<?php echo $action;?>" />
<input type="hidden" name="User_id" id="user_id" value="<?php echo $this->bind('id')?>">
	<div class="elem">
		<label for="user_username"> Username </label> <input type="text"
			name="User_username" id="user_username"
			value="<?php echo $this->bind('username')?>">
	</div>
	<div class="elem">
		<label for="user_password"> Password </label> <input type="password"
			name="User_password" id="user_password"
			value="<?php echo $this->bind('password')?>">
	</div>
	<div class="elem">
		<label for="user_numberphone"> Phone Number </label> <input type="text"
			name="User_numberphone" id="user_numberphone"
			value="<?php echo $this->bind('numberphone')?>">
	</div>
	<div class="elem">
		<label for="user_address"> Address </label> <input type="text"
			name="User_address" id="user_address"
			value="<?php echo $this->bind('address')?>">
	</div>
	<div class="elem">
		<label for="user_email"> Email </label> <input type="text"
			name="User_email" id="user_email"
			value="<?php echo $this->bind('email')?>">
	</div>
	<div class="elem">
		<label for="user_image"> Image </label> <input type="file"
			name="User_image" id="user_image"
			value="<?php echo $this->bind('image')?>">
	</div>
	<div class="elem">
		<label for="user_company"> Company</label>
			<select name="User_company" id="user_company">
				<?php		
					foreach ($this->relativeData as $entity) {
						if ($this->bind('company') == $entity['id'])
							echo '<option selected="selected" value="'.$entity['id'].'" >'.$entity['name'].'</option>';
						else
							echo '<option value="'.$entity['id'].'">'.$entity['name'].'</option>';
					}					
				?>
			</select>
	</div>
	<div class="elem">
		<label for="user_userpower"> Userpower</label>
			<select name="User_userpower" id="user_userpower">
				<?php		
					foreach ($this->relativeData1 as $entity) {
						if ($this->bind('userpower') == $entity['id'])
							echo '<option selected="selected" value="'.$entity['id'].'" >'.$entity['name'].'</option>';
						else
							echo '<option value="'.$entity['id'].'">'.$entity['name'].'</option>';
					}					
				?>
			</select>
	</div>
	<?php if($action=='insert')
		echo '<input type="hidden" name="User_status" id="user_status" value="1">';
	?>
	
	<button type="submit" onclick="document.boo.submit()" style="display: none;">Save</button>
</form>
